﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="customerUpdatePwdByAdmin.aspx.cs"
    Inherits="PeisongWeb.admin.customerUpdatePwdByAdmin" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<%@ Register TagName="top" Src="controls/top.ascx" TagPrefix="uc1" %>
<%@ Register TagName="menu" Src="controls/menu.ascx" TagPrefix="uc2" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>用户密码修改 - 想购网长期采购物流配送系统</title>
    <!--#include file="style.inc"-->

    <script type="text/javascript">
        function resetSrh() {
            document.getElementById("txt_companyName").value = "";
            document.getElementById("ddl_Type").value = "";
            document.getElementById("txt_mobile").value = "";
        }
        function checkPhoneNum() {
       //验证手机号码是否正确
            if(document.getElementById("chk_sendtophone").checked)
            {
                var phonenum=document.getElementById("txt_Phone");
                var t = /^13[0-9]{1}[0-9]{8}|^15[0-3]{1}[0-9]{8}|^15[5-9]{1}[0-9]{8}|^18[0]{1}[0-9]{8}|^18[5-9]{1}[0-9]{8}$/;
                if (phonenum.value.length > 11) {
                    alert("请输入正确的手机号码！");
                    return false; 
                }
                if(t.test(phonenum.value))
                {
                    return true;
                }
                else
                {
                    alert("请输入正确的手机号码!");
                    return false;
                }
            }       
            else
            {
                return true;
            }

        }
        function checkPwd() {
        //验证密码格式是否正确
            var pwd = document.getElementById("txt_Pwd").value;
            if (pwd.length > 0) {
                var t = /^(?![a-zA-Z]+$)(?![0-9]+$)[a-zA-Z0-9]{6,14}$/;
                if (t.test(pwd)) {
                    return true;
                }
                else {
                    alert("密码应为6-14个字母加数字的形式!");
                    return false;
                }
            }
            else {
                alert("密码不能为空!");
                return false;
            }
        }
        function checkAllItem() {
            if (checkPhoneNum() & checkPwd()) {
                return true;
            }
            else
                return false;
         }
        
        
        
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="sm1" runat="server">
    </asp:ScriptManager>
    <ext:ScriptManager ID="ScriptManager1" runat="server" />
    <uc1:top ID="Top1" runat="server" />
    <uc2:menu ID="Menu1" runat="server" />
    <div id="admin-body">
        <h2 class="section-cms">
            用户密码修改
        </h2>
        <p>
            &nbsp;</p>
        <ext:Panel ID="Panel1" runat="server" Title="合作企业搜索" BodyStyle="padding:5px 5px 0"
            Width="1200" Frame="true" ButtonAlign="Center">
            <Body>
                <div id="admin_edit_content_search">
                    <ul>
                        <li>
                            <label>
                                公司名称
                            </label>
                            <asp:TextBox runat="server" ID="txt_companyName"></asp:TextBox>
                        </li>
                        <li style="width: auto; margin-right: 20px">
                            <label>
                                类别
                            </label>
                            <asp:DropDownList runat="server" ID="ddl_Type" DataTextField="name" DataValueField="xm">
                            </asp:DropDownList>
                        </li>
                        <li style="width: auto">
                            <label style="width: auto">
                                用户联系电话
                            </label>
                            <asp:TextBox runat="server" ID="txt_mobile"></asp:TextBox>
                        </li>
                        <li>
                            <label>
                                &nbsp;
                            </label>
                            [<asp:LinkButton ID="lbtn_Search" runat="server" Text="搜 索" OnClick="lbtn_Search_Click" CausesValidation="false">
                            </asp:LinkButton>]&nbsp;&nbsp;&nbsp; [<a href="javascript:resetSrh();">重 置</a>]
                        </li>
                    </ul>
                </div>
            </Body>
        </ext:Panel>
        <p>
            &nbsp;</p>
        <div id="admin_list_content" style="width: 1200px;">
            <table cellpadding="0" cellspacing="0">
                <tr class="header-row">
                    <th>
                        类 别
                    </th>
                    <th>
                        用户账号
                    </th>
                    <th>
                        姓名
                    </th>
                    <th>
                        公司名称
                    </th>
                    <th>
                        用户手机
                    </th>
                    <th>
                        使用频率(次)
                    </th>
                    <th>
                        上次登录时间
                    </th>
                    <th>
                        上次修改密码时间
                    </th>
                    <th>
                        操作
                    </th>
                </tr>
                <asp:Repeater ID="rpt_list" runat="server" OnItemCommand="rpt_list_ItemCommand">
                    <ItemTemplate>
                        <tr class='<%# Container.ItemIndex%2==0? "row-alt":"alt"  %>'>
                            <td>
                                <%# Eval("typeName")%>
                            </td>
                            <td>
                                <%# Eval("username")%>
                            </td>
                            <td>
                                <%#DataBinder.Eval(Container.DataItem,"realName") %>
                            </td>
                            <td>
                                <%# Eval("company")%>
                            </td>
                            <td>
                                <%# Eval("phone")%>
                            </td>
                            <td>
                                <%# Eval("logintotal")%>
                            </td>
                            <td>
                                <%#DataBinder.Eval(Container.DataItem, "currentLoginDate")%>
                            </td>
                            <td>
                                <%# DataBinder.Eval(Container.DataItem,"lastPwdModifyDateTime") %>
                            </td>
                            <td>
                                <asp:LinkButton ID="lbt_update" runat="server" CommandName="Update" CommandArgument='<%# Eval("customerId") %>'
                                    Text="修改密码" CausesValidation="false">
                                </asp:LinkButton>
                            </td>
                        </tr>
                    </ItemTemplate>
                </asp:Repeater>
            </table>
            <div id="page">
                <webdiyer:AspNetPager ID="AspNetPager1" NumericButtonType="Text" MoreButtonType="Text"
                    OnPageChanged="AspNetPager1_PageChanged" runat="server" AlwaysShow="True" PageSize="20"
                    InvalidPageIndexErrorMessage="无效页码" PageIndexOutOfRangeErrorMessage="页码超出范围"
                    ShowCustomInfoSection="Left" CustomInfoHTML=" 每页%PageSize%条记录 | 总共%RecordCount%条记录 "
                    CustomInfoTextAlign="Left" HorizontalAlign="Right" NextPageText="下一页" FirstPageText="首页"
                    LastPageText="末页" PrevPageText="上一页">
                </webdiyer:AspNetPager>
            </div>
        </div>
        <ext:Window ID="pwd_update" runat="server" Title="修改密码" Height="250px" Width="600px"
            BodyStyle="padding: 6px; background-color: #fff;" AutoScroll="true" Modal="True"
            Resizable="false" ShowOnLoad="false" Draggable="false" Icon="ApplicationViewDetail">
            <Body>
                <asp:UpdatePanel runat="server" ID="up1" UpdateMode="Conditional">
                    <Triggers>
                    <asp:PostBackTrigger ControlID="btn_Save" />
                    </Triggers>
                    <ContentTemplate>
                        <div id="admin_edit_content">
                            <ul>
                                <li>
                                    <label>
                                        用户名
                                    </label>
                                    <asp:TextBox runat="server" ID="txt_Username" MaxLength="50"></asp:TextBox>
                                    
                                    <asp:HiddenField ID="hid_customerid" runat="server" />
                                </li>
                                <li>
                                    <label>
                                        姓 名
                                    </label>
                                    <asp:TextBox runat="server" ID="txt_Realname" MaxLength="50"></asp:TextBox>
                                </li>
                                <li>
                                    <label>
                                        联系电话
                                    </label>
                                    <asp:TextBox runat="server" ID="txt_Phone" MaxLength="50"></asp:TextBox>
                                </li>
                                <li>
                                    <label>
                                        是否发送到手机
                                    </label>
                                    <input runat="server" type="checkbox" id="chk_sendtophone" name="check1" />
                                    是 </li>
                                <li runat="server" id="li_updatepwd">
                                    <label>新密码</label>
                                    <asp:TextBox runat="server" ID="txt_Pwd" TextMode="Password" MaxLength="50"></asp:TextBox>
                                </li>
                                <li>
                                    <label>确认密码</label>
                                    <asp:TextBox runat="server" ID="txt_confim_Pwd" TextMode="Password" MaxLength="50"></asp:TextBox>
                                    <asp:CompareValidator runat="server" ID="passwordCompareValidatro" ControlToCompare="txt_Pwd" ControlToValidate="txt_confim_Pwd" ErrorMessage="两次密码输入不一致!" Display="Dynamic"></asp:CompareValidator>
                                </li>
                                <li>
                                    <label>
                                        &nbsp;
                                    </label>
                                    <span>
                                        <asp:Button runat="server" ID="btn_Save" Text="保 存" OnClick="btn_Save_Click" OnClientClick="return checkAllItem()"/>
                                    </span>
                                    <asp:Button ID="btn_Close" runat="server" Text="返 回" OnClick="btn_Close_Click" CausesValidation="false"/>
                                </li>
                            </ul>
                        </div>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </Body>
        </ext:Window>
    </div>
    </form>
</body>
</html>
